#!/bin/bash
$APPDIR/func -reset_gtk
export TEXTDOMAIN=pmusic
export OUTPUT_CHARSET=UTF-8
[ "$1" != "-txt1_file" ] && echo "$TXT1" > $WORKDIR/box_ok_txt1
[ -z "$IMG" ] && IMG="dialog-error"
[ -z "$FRAME" ] && FRAME="$(gettext 'Error')"
if [ "$IMG" = "info" ]; then #offer link to wiki in the heading for info boxes
	WIKI_TXT='
	<text width-request="20" '$SF'><label>""</label></text>
	<text wrap="false" ypad="47" use-markup="true" '$SF'>
	 <label>"<u><span color='"'blue'"'>'$(gettext 'Online Help')'</span></u>"</label>
	</text>'
	WIKI_LINK='<action signal="button-press-event">export GTK2_RC_FILES='$HOME'/.gtkrc-2.0; '$BROWSER' http://www.puppylinux.org/wikka/pmusicDoc &</action>'
	IMG=dialog-info
fi 

[ "$HEADING" ] && $APPDIR/func_svg -heading "$HEADING"

S='
<window icon-name="pmusic" title="pMusic" allow-grow="false">
 <vbox>'
  [ "$HEADING" ] && S=$S'
  <vbox space-expand="false" space-fill="false">
   <hbox spacing="0" height="75" scrollable="true" space-expand="true" space-fill="true" vscrollbar-policy="2" hscrollbar-policy="2">
    <eventbox name="svgheading" hover-selection="true" space-expand="true" space-fill="true">
     <hbox space-expand="true" space-fill="true">
     '$WIKI_TXT'
      <text space-expand="true" space-fill="true"><label>""</label></text>
       <vbox '$SF'>
        <pixmap ypad="5" icon_size="6"><input file stock="gtk-'$IMG'"></input></pixmap>
      </vbox>
     </hbox>
     '$WIKI_LINK'
    </eventbox>
   </hbox>
  </vbox>'
  S=$S'<frame '$FRAME'>'
   [ ! "$HEADING" ] && S=$S'<pixmap icon_size="6"><input file stock="gtk-'$IMG'"></input></pixmap>'
   S=$S'<text use-markup="true" selectable="true" can-focus="false"><input file>'$WORKDIR'/box_ok_txt1</input></text>'
   [ "$TXT2" ] && S=$S'<text use-markup="true" selectable="true" can-focus="false"><label>"'$TXT2'"</label></text>'
  S=$S'</frame>
  <hbox>
   <button can-default="true" has-default="true" use-stock="true">
    <input file stock="gtk-ok"></input>
    <label>'$(gettext 'Ok')'</label>
   </button>
  </hbox>
 </vbox>
</window>'

export ok_box="$S"
$GTKDIALOG -p ok_box --center
TXT1=""; TXT2=""; IMG=""; FRAME="" #reset to avoid alien values in next box
